<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/style.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/main.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/maina1.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/login.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/animate.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/my.css">-->


    <!--Bootstrap 引入--------->
    <!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/js/jquery.min.js"></script>-->
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <!--<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"-->
    <!--integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <!--<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"-->
    <!--integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"-->
    <!--crossorigin="anonymous"></script>-->
    <!--Bootstrap 引入 end -------------------------->


    <script type="text/javascript">
        $('#modal-replay').on('hidden.bs.modal', function () {
            // 关闭Dialog前移除编辑器
//            alert("销毁ueditor");
            //监听modal消失
//            UE.getEditor('replay_container').destroy();
//            UE.delEditor('replay_container');
        });
    </script>
    <script type="text/javascript">
        function replayartcle() {
//            alert("打开回复");
            var ue2 = UE.getEditor('replay_container', {toolbars: [['fontfamily', 'simpleupload', 'fontsize', 'forecolor', 'link']]});
            ue2.addListener("ready", function () {
//                alert("打开模态框");
            });
              if (ue2.isReady)
              {
//                  alert("打开模态框2");
              }
            $("#modal-replay").modal('show');

        }
    </script>


</head>
<body>


<?php if(is_array($items)): $i = 0; $__LIST__ = $items;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$items): $mod = ($i % 2 );++$i;?><!----防止富文本消失--->
    <script type="text/javascript">
        UE.delEditor('replay_container');
    </script>
    <!--------防止富文本消失 END------>
    <script type="text/javascript">
        function setzan() {
//            alert("点赞" + '<?php echo ($items["itemid"]); ?>');
            var zid = '<?php echo ($items["itemid"]); ?>';
            $.post("/taobao_3dchat/index.php/Index/CGood", {'id': zid}, function (data) {
//           alert("收到回复"+data.status);
                console.log("data.status:" + data.status);
                switch (data.status) {
                    case 1:
                        alert("点赞成功");
                        var a = document.getElementById("zan" + zid);
//                    alert(data.goodsnum);
                        a.innerHTML = data.goodsnum;
                        var b = document.getElementById("bad" + zid);
                        b.innerHTML = data.badnum;
//                        alert(data.badnum);
                        break
                    case 2:
                        alert("已经点过赞了");
                        break
                    case 3:
                        alert("尚未登陆");
                        break
                }
            }, "json");
        }
    </script>
    <script type="text/javascript">
        function setbad() {
//            alert("踩" + '<?php echo ($items["itemid"]); ?>');/**/
            var zid = '<?php echo ($items["itemid"]); ?>';
            $.post("/taobao_3dchat/index.php/Index/CBad", {'id': zid}, function (data) {
//           alert("收到回复"+data.status);
                console.log("data.status:" + data.status);
                switch (data.status) {
                    case 1:
                        alert("踩人成功");
                        var a = document.getElementById("zan" + zid);
//                    alert(data.goodsnum);
                        a.innerHTML = data.goodsnum;
                        var b = document.getElementById("bad" + zid);
                        b.innerHTML = data.badnum;
//                        alert(data.badnum);
                        break
                    case 2:
                        alert("已经踩过了");
                        break
                    case 3:
                        alert("尚未登陆");
                        break
                }
            }, "json");
        }
    </script>
    <script type="text/javascript">
        function replay2(id) {

            $.post("/taobao_3dchat/index.php/Index/referenceItem",{'id':id},function (data) {
                switch (data.status)
                {
                    case 1:
                        $("#modal-replay").modal('show');
                        var ue2 = UE.getEditor('replay_container', {toolbars: [['fontfamily', 'simpleupload', 'fontsize', 'forecolor', 'link']]});
                        ue2.addListener("ready", function () {
//                alert("编辑器就绪");
                            ue2.setContent(data.content);
                        });
                        if (ue2.isReady)
                        {
//                alert("编辑器就绪2");
                            ue2.setContent(data.content);
                        }
                        break;
                }
            });




        }

    </script>

    <script type="text/javascript">
        function replay() {
            var ue2 = UE.getEditor('replay_container');
            var content = ue2.getContent();
            if (content.length>0)
            {
            $.post("/taobao_3dchat/index.php/Index/replayItems/id/<?php echo ($items["itemid"]); ?>", {'myContent': content}, function (data) {

                switch (data.status) {
                    case 1:
                        alert("回复成功");
                        $("#right_main_page").load("/taobao_3dchat/index.php/index/getitems/id/" + '<?php echo ($items["itemid"]); ?>', function () {

                        });
                        break
                }
            }, "json");
        }
        else
            {
                alert("回复内容不能为空");
            }
        }

    </script>

    <div class="modal fade" id="modal-replay" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"
                            style="margin-bottom: 6px">x
                    </button>
                </div>
                <div class="modal-body">
                    <div style="height: 300px;width: 100%;bottom: 10px;display: block">
                        <script id="replay_container" name="myContent" type="text/plain" class="edui-default"
                                style="height: 200px">
                        </script>
                    </div>
                    <div class="form-group ">
                        <div class="g-recaptcha" data-sitekey="<?php echo ($siteKey); ?>"></div>
                        <script type="text/javascript"
                                src="https://www.google.com/recaptcha/api.js?hl=en">
                        </script>
                    </div>
                </div>
                <div class="modal-footer">
                    <input class="btn btn-primary btn-lg btn-block" type="submit" value="回复" onclick="replay()"
                           data-dismiss="modal" aria-label="Close">
                </div>
            </div>
        </div>
    </div>
    <div class="rightlistsize">
        <div class="listitem_font2">
            <div class="listitem_font2"
                 style="display: inline;font-size: 10px ;margin-right: 10px;margin-left: 10px;">
                #<?php echo ($i); ?>
            </div>
            <div class="right_list_name2"
                 style="display: inline">
                <?php echo ($items["nickname"]); ?>

            </div>
            <div class="listitem_font2" style="margin-left: 8px;font-size: 10px; display: inline ;">
                time: <?php echo (date("Y-m-d H:i:s",$items["time"])); ?>
            </div>
            <div class="listitem_font2"
                 style="margin-left: 8px;font-size: 10px; display: inline ;color: #e74c3c;float: right;margin-right: 20px"
                 onclick="replay2('<?php echo ($items["id"]); ?>')" >
                引用
            </div>
        </div>
        <div class="listitem_font2">
            <div class="right_list_title2" style="display: inline ;margin-left: 20px;line-height: 30px">
                <?php echo ($items["content"]); ?>
            </div>

        </div>

    </div><?php endforeach; endif; else: echo "" ;endif; ?>
</body>
<!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/js/main.js"></script>-->
<!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/js/new.js"></script>-->
</html>